---@class Battle.Card
---@field New fun():Battle.Card
local Card = Battle.CreateClass("BattleCard")
Battle.Card = Card
function Card:Set(heroId,level)
    self.heroId = heroId
    self.level = level
    local cfg = DataTable.GetById("t_hero",heroId)
    if cfg == nil then
        logError("找不到t_hero ："..heroId)
        return self
    end
    self.weight = cfg.f_RandomWeight
    self.cost = cfg.f_ConsumeEnergy
    self.num = 1--cfg.f_HeroCount or 1
    return self
end